M = int(input("请输入区间左端点M:"))
N = int(input("请输入区间右端点N:"))
primes = []
for num in range(M, N + 1):
    if num > 1:
        is_prime = True
        for i in range(2, int(num ** 0.5) + 1):
            if num % i == 0:
                is_prime = False
                break
        if is_prime:
            primes.append(num)
if primes:
    print("区间内的素数：" + ",".join(map(str, primes)))
    print("素数个数：", len(primes))
    print("素数之和：", sum(primes))
else:
    print("该区间内无素数")